$(function(){
	var baseUrl="https://gzflower.bluej.cn/";
	var code = baseUrl+"index/Qrcode/code";  //获取二维码
	
	var token = localStorage.getItem('token');
	var uname = localStorage.getItem('uname');
	var show_id = localStorage.getItem('show_id');
	var day_time = localStorage.getItem('day_time');
	var start_time = localStorage.getItem('start_time')
	
	$('.span').text(uname);
	$('.text span').text(day_time +' '+ start_time);
	$.ajax({
		type:"post",
		url:code,
		async:true,
		data:{
			"access_token":token,
			"show_id":show_id,
			"day_time":day_time,
			"uname":uname
		},
		success:function(res){
			console.log(res)
			var img_src = res.data.data;
			$('.pic>img').attr('src',img_src)
			preservation();
		},
		error:function(e){
			console.log('错误',e);
		}
	})
	function preservation(){
		html2canvas(document.querySelector('.container')).then(function(canvas) {
//			document.body.appendChild(canvas);
			//将canvas转为base64位图片
			console.log(canvas.toDataURL())
			//将图片下载到本地（通过链接实现）
			btn.src=canvas.toDataURL();
		})
	}
	
})
